<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">   
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta content="yes" name="apple-touch-fullscreen">
		<meta content="telephone=no" name="format-detection">
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<meta name="keywords" content="">
		<meta name="description" content="">
		<title></title>
		<script src="js/index.js"></script>
		<script src="js/jquery.min.js"></script>
		<link rel="stylesheet" href="css/reset.css"/>
		<link rel="stylesheet" href="css/index.css"/>
	</head>
	<body>
		<header class="header">
			<img src="img/logo.png" alt="" />
		</header>
		<section class="userInfoBg" >
			<div class="userImg">
				<img id="leaderImg" src="http://ci.nabaiuf.com/images/t_hzmj_1.png" alt="头像"/>
			</div>
			<div id="userCard" class="userCard">
			不愿透露姓名的市民刘新源同志
			</div>
		</section>
		<section class="item1" >
			<div class="itemList1">
				<div class="itemListTextTop1">
					欢迎您加入<span id="clubName">【俱乐部名称七位】</span>俱乐部
				</div>
			</div>
		</section>
	
		<section class="item3" >
			<div class="itemList3">
				<ul class="itemListBottom3">
					<li class="clearfix">
						<div class="itemListBottom3L fl">
							俱乐部人数
						</div>
						<div class="itemListBottom3R fr">
							<span id="peopleNum">3243</span>人
						</div>
					</li>
					<li class="clearfix">
						<div class="itemListBottom3L fl">
							俱乐部玩法
						</div>
						<div class="itemListBottom3R fr">
							<span id="rule">长沙麻将</span>
						</div>
					</li>
				</ul>
			</div>
		</section>
		<footer class="footerBg" onclick="console.log(this)">
			<div class="androidfooter clearfix">
				<div id="down" class="fl" onclick="download_app()">下载游戏</div>
				<div id="add" class="fr">加入俱乐部</div>
				<div id="unadd" class="fr">已加入俱乐部</div>
			</div>
		</footer>
		<div id="wxBg">
			<img src="img/tc_down.png"/>
		</div>
	</body>
	<script>
		var a='function f(){console.log(1)}'
		eval(a)
		var code = GetQueryString('code');
        var clubId = GetQueryString('clubId');
        var leaderPortrait = GetQueryString('leaderPortrait');
        var leaderNickname = GetQueryString('leaderNickname');
        var clubName = GetQueryString('clubName');
        var clubNum = GetQueryString('clubNum');
        var gameName = GetQueryString('gameName');
        var status = GetQueryString('status');
        var userId=GetQueryString('userId');
        var sysType = getSysType();
        var wxBg = document.getElementById('wxBg');
        var androidUrl='javascript:;';
        var iosUrl='javascript:;';
        $('#leaderImg').attr('src',leaderPortrait)
		$('#userCard').html(leaderNickname)
		$('#clubName').html(clubName)
		$('#peopleNum').html(clubNum)
		$('#rule').html(gameName)
		if(status==1){
    		$('#unadd').show()
    		$('#add').hide()
    	}
// 		$.ajax({
//             url:'/platform/club/invite/info',
//             type:'post',
//             data:{
//                 code:code,
//                 clubId:clubId
//             },
//             dataType:'json',
//             success:function(data){
//             		if (data.code==0) {
//             			userId=data.data.userId
            			
// //          			$('#down').click(function(){
// //          				var url ="";
// //				        if("android"==sysType){
// //				        		//data.url
// //				            url = 'http://file.nabaiuf.com/apk_hzmj.apk';
// //				        }else{
// //				            url="http://static.nabaiuf.com/down/lsmj"
// //				        }
// //				        window.location.href=url;
// //          			})
//             		}else{
//             			var content=data.message
//             			Popup (content)
//             		}
//             }
//         })
		
        if("iphone"==sysType){
            $("#wxBg").find('img').attr('src','./img/tclog_iphone.png');
        }
		//背景点击隐藏
		// wxBg.addEventListener('touchstart',function(){
		// 	if(isWexin()){
		// 		wxBg.style.display='none'
		// 	}
		// })
		//弹出提示
		// function showTips() {
  //           if(!isWexin()){
  //               download_app();
  //           }else{
  //               wxBg.style.display='block'; 
  //           }
	 //    }
		function download_app(){
	        if("android"==sysType){
	            window.location.href = androidUrl;
	        }else{
	            window.location.href = iosUrl
	        }  
	    }
		$('#add').click(function(){
			if(!userId){
				return false;
			}
            $.ajax({
	            url:'/platform/club/apply/add',
	            type:'post',
	            data:{
	                userId:userId,
	                clubId:clubId
	            },
	            dataType:'json',
	            success:function(data){
		            	var content=data.message
		            	if(data.code==0){
		            		$('#unadd').show()
		            		$('#add').hide()
		            	}
		            	// alert(content)
		            	Popup (content)
	            }
	        })
		})
		var a=1
		Popup (a)
	</script>
</html>
